package cn.wubo.redis.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pubAndSub")
public class RedisPubAndSubController {

    @Autowired
    private StringRedisTemplate stringRedisTemplate;

    @RequestMapping(value = "/convertAndSend", method = RequestMethod.GET)
    public void convertAndSend(String channel, String message) {
        stringRedisTemplate.convertAndSend(channel,message);
    }
}
